package com.bonc.modules.item.utils;

import java.util.Objects;

/**
 * @author jinlong
 * @date 2021/8/11
 */
public enum QuarterEnum {
    FIRST("0331", "第一季度"),
    SECOND("0630", "第二季度"),
    THIRD("0930", "第三季度"),
    FOURTH("1231", "第四季度"),
    FIFTH("0330", "第一季度"),
    SIXTH("1230", "第四季度");

    private String code;
    private String desc;

    QuarterEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public String toString() {
        return desc;
    }

    public static QuarterEnum getByCode(String code) {
        for (QuarterEnum type : values()) {
            if (Objects.equals(type.code, code)) {
                return type;
            }
        }
        return null;
    }
}
